<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function Validate()
{
	
	if(document.gedadd.title.value=="")
	{
		alert("Gadget Name Missing");
		document.gedadd.title.focus();
		return false;
	}
	
	var exp = /^.+\.(jpg|gif|jpeg|JPG|JPEG|GIF|png|PNG)$/;
		if (!exp.test(document.gedadd.upload.value))
		{				   
			alert("Please Choose JPG OR GIF File");
			return false;
		}	
}

</script>
<form name="gedadd" method="post" enctype="multipart/form-data" action="index.php?tc=gedget_addcode" onSubmit="return Validate();">
<?php
if($_REQUEST['_e'] == 2)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Gadget submitted successfully.</div></td>
    </tr>    
    </table>
<?php } ?>
<?php
if($_REQUEST['_e'] == 1)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Invalid file format.</div></td>
    </tr>    
    </table>
<?php } ?>
<table width="99%" align="center" border="0"  class="list">
<thead>
<tr>
	<td colspan="2" align="left">
        <div style="float:left" class="righthead">Gadget Details</div>
        <div style="float:right">
        <a href="index.php?tc=gadget" class="back">Back</a></div>
    </td>
</tr>
</thead>
<tr>
	<td align="right" width="250">Gadget Name *</td>
    <td align="left"><input class="text" name="title" type="text"/></td>
</tr>
<tr>
	<td align="right" width="250" valign="top">Gadget Description</td>
    <td align="left">
    <textarea name="maincont" id="maincont" class="textarea" cols="45" rows="8"><?php echo stripslashes($data['book_desc']);?></textarea>
        <script type="text/javascript">CKEDITOR.replace( 'maincont',{skin : 'kama'});</script>
    </td>
</tr>
<tr>
	<td align="right" width="250">Gadget Image *</td>
    <td align="left"><input type="file" name="upload" />
    </td>
</tr>
<tr>
  <td align="right" width="150">Status :</td>
  <td align="left">
  <input name="authorised" type="radio"  value=1 checked="checked" />&nbsp;Active&nbsp;&nbsp;
  <input name="authorised" type="radio" value=0 />&nbsp;Deactive</td>
</tr>


<tr>
	<td align="right" width="150"></td>
    <td align="left"><input type="submit" value="Submit" name="save_gadget">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>